package com.park.mer.controller.mernotice;

import com.park.controller.BaseController;
import com.park.entity.mer.MerUserInfoLoginDto;
import com.park.entity.notice.OrderNoticeVo;
import com.park.mer.anno.MerUserToken;
import com.park.mer.service.notice.OrderNoticeService;
import com.park.response.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author ZhangHaiWen
 * @title: OrderNoticeController
 * @projectName park
 * @description: 订单通知列表
 * @date 2020/5/820:57
 */
@RestController
@RequestMapping(value = "/wx/merorder")
public class OrderNoticeController extends BaseController {


    @Autowired
    private OrderNoticeService orderNoticeService;

    /**
     * 商户收到通知
     * @param merUserInfoLoginDto
     * @return
     */
    @MerUserToken
    @RequestMapping(value = "/getnotices",method = RequestMethod.POST)
    public Result getNotices(@RequestBody MerUserInfoLoginDto merUserInfoLoginDto){
        Integer userId = getUserId();
        List<OrderNoticeVo> orderNoticeVoList = orderNoticeService.getNotices(merUserInfoLoginDto,userId);
        return SUCCESS(orderNoticeVoList);
    }

}
